<template>
	<view class="map-block">
		<hx-navbar :fixed="true" left-text="返回" title="商家地图" color="#ffffff" barPlaceholder="auto" :background-color="[249, 180, 6]"></hx-navbar>
		<map class="map"  :latitude="lat" :longitude="lng" :markers="covers"> </map>
	</view>
</template>

<script>
	export default{
		props:{
			
		},
		data(){
			return {
				lat:'',
				lng:'',
				covers:[],
			}
		},
		onLoad(options) {
			let address = options.address||'';
			let lng_lat = options.lng_lat||'';
			let lng_lat_arr = lng_lat.split(',')
			if(lng_lat_arr.length==2){
				this.lng = lng_lat_arr[0]
				this.lat = lng_lat_arr[1]
				this.covers.push({
					latitude: this.lat,
					longitude: this.lng,
					title: address,
				})
			}
			console.log(`lng=${this.lng},,lat=${this.lat}`)
		},
		methods:{
			
		}
	}
</script>

<style>
	uni-page-body,page{height: inherit;}
	.map-block{display: flex;flex-direction: column;height: inherit;}
	.map-block .map{flex: 1;width: 100%; }
</style>
